1. Field of the Invention
The present invention relates to a data compression apparatus which compresses data such as image data and a data compression program storage medium in which a data compression program for causing an information processing apparatus such as a computer to operate as the data compression apparatus is stored.
2. Description of the Related Art
There has been broadly adopted a technique for compressing data such as image data to reduce storage capacity or communication traffic.
For example, in Japanese Patent Laid-Open No. 05-328142, the following technique is disclosed. When representative colors are selected from an original image to configure a CLUT (color lookup table), color numbers are assigned so that a sequence of color numbers may indicate color data of close values. Then, a bitmap in accordance with the CLUT is created, and difference between color numbers of adjacent pixels is obtained. When the value of the difference is large, the color numbers of the bit map are changed within such a range that image quality deterioration is not caused to reduce the difference to be a smaller value, and run-length encoding is performed for the difference data.
In Japanese Patent Laid-Open No. 10-164620, the following technique is proposed. Data for image which is configured by multiple data, each of which is assigned to each color, is lossily compressed and encoded. Then, one of the data is assigned to transparent color, and the transparent color is to be losslessly compressed. Each data is configured by an immediate value (the first value in difference encoding) and multiple difference values (previous values in the difference encoding) following the immediate value. When these values are lossily compressed and encoded, the immediate value and difference values indicating the transparent color is losslessly compressed. Furthermore, the immediate value indicating the transparent color may be an intermediate value among the data values of the respective colors, or the difference values indicating the transparent color may be set to “0”.
In Japanese Patent Laid-Open No. 2001-5-20822, it is proposed to encode a number based on difference between a predicted number (s′(j)) and an actual number (s(j)).
In Japanese Patent Laid-Open No. 09-200540, an image compression apparatus is proposed which recognizes, for a pixel data sequence on the n-th column, the distribution condition of the same pixel data in the vertical scanning direction as well as the distribution condition of the same pixel data in the horizontal scanning direction, and determines whether to perform compression processing for the same pixel data continuing in the vertical scanning direction or to perform compression processing for the same pixel data continuing in the horizontal scanning direction, based on the recognition result.
Here, a system to which a data compression technique is applied will be introduced.
FIG. 1 shows an example of a print system to which a data compression technique is applied, and FIG. 2 is a diagram showing the flow of data processing in the print system.
As shown in FIG. 1, this print system is constituted by a host controller 100, an interface device 200 and a printer 300. The host controller 100 and the interface device 200 are connected via an interface cable 150, such as a SCSI cable, and the interface device 200 and the printer 300 are connected via an interface cable 250.
As shown in FIG. 2, inside the host controller 100, data 11 of characters and images written in various languages or formats, such as PDF, PS and TIFF, are classified as image (CT: continuous tone) data and character or line (LW: line work) data. Then, by performing RIP (raster image processing) for each of them, bitmap data 12A and 13A are generated. Furthermore, data compression processing is performed for each of them to generate lossily compressed data 14 for CT and losslessly compressed data 15 for LW. These compressed data 14 and 15 are transferred from the host controller 100 to the interface device 200 via the general-purpose interface cable 150 shown in FIG. 1. In the interface device 200, data expansion processing is performed for the transferred, compressed data 14 and 15 to generate bitmap data 12B and 13B corresponding to the bitmap data 12A and 13A for which the data compression processing at the host controller 100 has not been performed yet. In this case, since lossy compression processing has been performed for the CT data in the data compression at the host controller 100, the CT data after the data expansion (the bitmap data 12B) is not completely recovered to the CT data before the data compression (the bitmap data 12A). However, almost the same bitmap data is recovered. As for the LW data, since lossless compression processing has been performed in the data compression at the host controller 100, the LW data after the data expansion (the bitmap data 13B) is recovered to the same data as the LW data before the data compression (the bitmap data 13A).
In the interface device 200, the CT data (the bitmap data 12B) and the LW data (the bitmap data 13B) after the data expansion are synthesized, and sent to the printer 300 with halftone dot information and the like added thereto. In the printer 300, an image is print-outputted in accordance with the bitmap data and the tag information added thereto which have been received from the interface device 200.
For example, when the host controller 100 and the interface device 200 are located away from each other, or when it is necessary to configure the host controller 100 and the interface device 200 as separate apparatuses, such as in the case of a system in which the interface device 200 receives image data from multiple host controllers, it is possible to shorten the time required for data transfer from the host controller 100 to the interface device 200 and enhance print productivity by making such a configuration in which data compression is performed by the host controller 100, the data is transferred to the interface device 200, and data expansion is performed at the interface equipment, as shown in FIG. 2.
In this case, in general, a compression method which is lossy compression but the compression ratio of which is high, such as JPEG, is adopted for the CT data, and a lossless compression method such as Pack Bits is adopted for the LW data.
However, the compression method such as JPEG requires time for compression processing by software, and this causes deterioration of the throughput of the entire compression processing system.
In consideration of the above situation, the present invention provides a data compression apparatus and a data compression program storage medium capable of performing new, preferable compression processing which is applicable to compression of CT data.